<?php
declare (strict_types=1);

namespace app\controller\admin;

use app\common\controller\BaseController;
use app\model\admin\PropMember as propMemberModel;
use think\App;
use \Throwable;

class PropMember extends BaseController
{
    protected $model;

    public function __construct(App $app, propMemberModel $model)
    {
        parent::__construct($app);
        $this->model = $model;
    }

    /**
     * 赠送道具
     */
    public function giveProp()
    {
        try {
            if (empty($this->params['member_id'])) {
                return $this->returnError(-1, [], '用户ID不存在');
            }
            return $this->model->giveToMember($this->params);
        } catch (\Exception $ex) {
            return $this->returnException($ex);
        }
    }
}
